package mystructs;

import com.opensymphony.xwork2.ActionSupport;

public class testAction extends ActionSupport {

	public String execute() throws Exception {
		this.LOG.debug("hello1");
		this.LOG.info("HELLO2");
		System.out.println("testAction.execute");
		System.out.println("username:"+this.getUsername());
		System.out.println("password:"+this.getPassword());
		String nextpag="";
		if(username==null&&password==null){
		this.setMes("wellcom ");
		nextpag="testlogin";
		}else if("Tom".equals(username)&&"1234".equals(password)){
		this.setMes("登入成功");	
		nextpag="SUCCESS";
		}else if(!"Tom".equals(username)||!"1234".equals(password))
		{
			this.setMes("重新確認帳號密碼");
			nextpag="testlogin";
			
		}
		return nextpag;
		
	}
	public String getMes() {
		return mes;
	}
	public void setMes(String mes) {
		this.mes = mes;
	}
	String username;
	String password;
	String mes;
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
}
